package com.ydx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ydx.entity.Shiyanshi;
import com.ydx.service.ShiyanshiService;
import com.ydx.mapper.ShiyanshiMapper;
import com.ydx.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author zero
* @description 针对表【shiyanshi】的数据库操作Service实现
* @createDate 2024-06-18 15:51:28
*/
@Service
public class ShiyanshiServiceImpl extends ServiceImpl<ShiyanshiMapper, Shiyanshi>
    implements ShiyanshiService{


    @Override
    public List<Shiyanshi> SelectByUserid(int userid) {
        // 假设使用MyBatis-Plus的查询方法，根据userid查询数据库中符合条件的实验室信息列表
        QueryWrapper<Shiyanshi> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("userid", userid); // 假设数据库字段名为user_id

        return this.list(queryWrapper); // 使用MyBatis-Plus提供的list方法执行查询
    }

}




